#include <iostream>

#include <string>

using namespace std;

class Salary{

private:

    double Wage,Subsidy,Rent,WaterFee,ElecFee;//基本工资Wage，岗位工资Subsidy，房租Rent，水费WaterFee，电费ElecFee

public:

    Salary(double i1,double i2=0,double i3=0,double i4=0,double i5=0){//初始化工资数据的各分项

        Wage=i1;

        Subsidy=i2;

        Rent=i3;

        WaterFee=i4;

        ElecFee=i5;

    }

    Salary(){//初始化工资的各分项数据为0

        Wage=Subsidy=Rent=WaterFee=ElecFee=0;

    }

    void setWage(double f){Wage=f;}

    double getWage(){return Wage;}



    void setSubsidy(double f){Subsidy=f;}

    double getSubsidy(){return Subsidy;}



    void setRent(double f){Rent=f;}

    double getRent(){return Rent;}



    void setWaterFee(double f){WaterFee=f;}

    double getWaterFee(){return WaterFee;}



    void setElecFee(double f){ElecFee=f;}

    double getElecFee(){return ElecFee;}



    double RealSalary(){//计算实发工资,实发工资=Wage+Subsidy-Rent-WaterFee-ElecFee

        return Wage+Subsidy-Rent-WaterFee-ElecFee;}

};

//你的代码将被嵌在这里
static int n=0;
class Worker
{
private:
    string name,dept;
    int year;

public:
    Worker(string a,int b=0,string c=NULL)
    {
        name=a;
        year=b;
        dept=c;
        n++;
    }
    Worker()
    {
        year=0;
        n++;
    }
    void setName(string a)
    {
        name=a;
    }
    void setAge(int a)
    {
        year=a;
    }
    void setDept(string a)
    {
        dept =a;
    }
    string getName()
    {
        return name;
    }
    int getAge()
    {
        return year;
    }
    string getDept()
    {
        return dept;
    }
    int getNum()
    {
        return n;
    }

};

int main(){

    Worker w1("John",30,"design");

    Worker w2;

    cout<<"the total num is: "<<w1.getNum()<<endl;

    w2.setName("Linda");

    cout<<"in w2 the name is: "<<w2.getName()<<endl;

    return 0;

}